package pro.jiug.kExcel.utils;


import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Properties;


public final class FastDfsUtils {
	
	private static Properties properties_fastdfs;

	static {
		properties_fastdfs = new Properties();

		InputStream fastdfs = FastDfsUtils.class.getClassLoader().getResourceAsStream("fastdfs.properties");
		try {
			properties_fastdfs.load(fastdfs);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	//getWebServerUrl
	public static String getFastdfsWebServerUrl(){
		return properties_fastdfs.getProperty("fileServerUrl");
	}
	public static String getFastdfsBatchWebServerUrl(){
		return properties_fastdfs.getProperty("fileBatchServerUrl");
	}
	public static String getMaxFileSize(){
        return properties_fastdfs.getProperty("fdfs.maxFileSize");
    }
    public static String getStorageIp(){
        return properties_fastdfs.getProperty("fdfs.storage.ip");
    }
    public static String getStoragePath(){
        return properties_fastdfs.getProperty("fdfs.storage.path");
    }
    public static String getStorageUser(){
        return properties_fastdfs.getProperty("fdfs.storage.user");
    }
    public static String getStoragePassword(){
        return properties_fastdfs.getProperty("fdfs.storage.password");
    }

	/**
	* 根据文件后缀获取mimetype类型
	* @Description
	* @Param
	* @Param
	* @Author hkl
	* @Date 2020/6/29 13:32
	*/
	public static HashMap<String,String> getFileMimeType(){
        HashMap<String, String> map = new HashMap<>();
        map.put("fif","application/fractals");
        map.put("css","text/css");
        map.put("ps","application/postscript");
        map.put("wsc","text/scriptlet");
        map.put("sst","application/vnd.ms-pki.certstore,vnd.ms-pki.certstore");
        map.put("mov","video/quicktime");
        map.put("xml","application/xml,text/xml");
        map.put("xlam","application/vnd.ms-excel.addin.macroEnabled.12");
        map.put("ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12");
        map.put("docm","application/vnd.ms-word.document.macroEnabled.12");
        map.put("rqy","text/x-ms-rqy");
        map.put("nix","application/x-mix-transfer");
        map.put("apk","application/vnd.android.package-archive");
        map.put("3g2","audio/3gpp2");
        map.put("itms","application/x-itunes-itms");
        map.put("zip","application/x-zip-compressed,application/zip");
        map.put("dvr-ms","video/x-ms-dvr");
        map.put("png","image/png,image/x-png");
        map.put("eprtx","model/vnd.eprtx+xps");
        map.put("thmx","application/vnd.ms-officetheme");
        map.put("mpo","image/mpo");
        map.put("odc","text/x-ms-odc");
        map.put("au","audio/basic");
        map.put("pns","image/pns");
        map.put("wtv","video/wtv");
        map.put("doc","application/msword");
        map.put("accdb","application/msaccess");
        map.put("odp","application/vnd.oasis.opendocument.presentation");
        map.put("accda","application/msaccess.addin");
        map.put("odt","application/vnd.oasis.opendocument.text");
        map.put("ods","application/vnd.oasis.opendocument.spreadsheet");
        map.put("xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template");
        map.put("aac","audio/aac");
        map.put("wdp","image/vnd.ms-photo");
        map.put("accdc","application/msaccess.cab");
        map.put("vsd","application/vnd.ms-visio.viewer");
        map.put("accde","application/msaccess.exec");
        map.put("flac","audio/x-flac");
        map.put("mid","audio/mid,audio/midi,audio/x-mid,audio/x-midi,midi/mid");
        map.put("accdr","application/msaccess.runtime");
        map.put("wma","audio/x-ms-wma");
        map.put("osdx","application/opensearchdescription+xml");
        map.put("vsi","application/ms-vsi");
        map.put("pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12");
        map.put("3gp2","video/3gpp2");
        map.put("wmd","application/x-ms-wmd");
        map.put("ac3","audio/vnd.dolby.dd-raw");
        map.put("iqy","text/x-ms-iqy");
        map.put("accdw","application/msaccess.webapplication");
        map.put("cer","application/pkix-cert,application/x-x509-ca-cert,pkix-cert,x-x509-ca-cert");
        map.put("ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow");
        map.put("wmf","image/x-wmf");
        map.put("accdt","application/msaccess.template");
        map.put("ec3","audio/ec3");
        map.put("xltm","application/vnd.ms-excel.template.macroEnabled.12");
        map.put("epub","application/epub+zip");
        map.put("vcf","text/directory,text/directory;profile=vCard,text/vcard,text/x-vcard");
        map.put("man","application/x-troff-man");
        map.put("3gp","audio/3gpp");
        map.put("dotx","application/vnd.ms-word.template.12,application/vnd.openxmlformats-officedocument.wordprocessingml.template");
        map.put("xlsx","application/vnd.ms-excel.12,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
        map.put("wmv","video/x-ms-wmv");
        map.put("website","application/x-mswebsite");
        map.put("wmx","video/x-ms-wmx");
        map.put("wmz","application/x-ms-wmz");
        map.put("svg","image/svg+xml");
        map.put("one","application/msonenote");
        map.put("edrwx","model/vnd.edrwx+xps");
        map.put("dotm","application/vnd.ms-word.template.macroEnabled.12");
        map.put("appcontent-ms","application/windows-appcontent+xml");
        map.put("ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12");
        map.put("docx","application/vnd.ms-word.document.12,application/vnd.openxmlformats-officedocument.wordprocessingml.document");
        map.put("itpc","application/x-itunes-itpc");
        map.put("jtx","application/x-jtx+xps");
        map.put("xaml","application/xaml+xml");
        map.put("txt","text/plain");
        map.put("ppt","application/vnd.ms-powerpoint");
        map.put("xlsm","application/vnd.ms-excel.sheet.macroEnabled.12");
        map.put("wvx","video/x-ms-wvx");
        map.put("xps","application/vnd.ms-xpsdocument");
        map.put("z","application/x-compress");
        map.put("p7b","application/x-pkcs7-certificates,x-pkcs7-certificates");
        map.put("xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12");
        map.put("dib","image/bmp");
        map.put("p7c","application/pkcs7-mime");
        map.put("dtcp-ip","application/x-dtcp1");
        map.put("mka","audio/x-matroska");
        map.put("swf","application/x-shockwave-flash");
        map.put("xht","application/xhtml+xml");
        map.put("asx","application/x-mplayer2,application/x-wmplayer,video/x-ms-asf,video/x-ms-asf-plugin");
        map.put("p7m","pkcs7-mime");
        map.put("accft","application/msaccess.ftemplate");
        map.put("p7r","application/x-pkcs7-certreqresp,x-pkcs7-certreqresp");
        map.put("dwfx","model/vnd.dwfx+xps");
        map.put("potm","application/vnd.ms-powerpoint.template.macroEnabled.12");
        map.put("3gpp","video/3gpp");
        map.put("p7s","application/pkcs7-signature,pkcs7-signature");
        map.put("latex","application/x-latex");
        map.put("hqx","application/mac-binhex40");
        map.put("p10","application/pkcs10,pkcs10");
        map.put("p12","application/x-pkcs12,x-pkcs12");
        map.put("tif","image/tiff");
        map.put("ico","image/x-icon");
        map.put("sldm","application/vnd.ms-powerpoint.slide.macroEnabled.12");
        map.put("contact","text/x-ms-contact");
        map.put("sldx","application/vnd.openxmlformats-officedocument.presentationml.slide");
        map.put("ics","text/calendar");
        map.put("mkv","video/x-matroska");
        map.put("html","text/html");
        map.put("xbap","application/x-ms-xbap");
        map.put("tar","application/x-tar");
        map.put("spl","application/futuresplash");
        map.put("pptx","application/vnd.ms-powerpoint.12,application/vnd.openxmlformats-officedocument.presentationml.presentation");
        map.put("wpl","application/vnd.ms-wpl");
        map.put("mpeg","video/mpeg,video/mpg,video/x-mpeg,video/x-mpeg2a");
        map.put("emf","image/x-emf");
        map.put("itls","application/x-itunes-itls");
        map.put("aiff","audio/aiff,audio/x-aiff");
        map.put("gif","image/gif");
        map.put("amr","audio/amr");
        map.put("m3u","audio/mpegurl,audio/x-mpegurl");
        map.put("vsto","application/x-ms-vsto");
        map.put("adts","audio/vnd.dlna.adts");
        map.put("hta","application/hta");
        map.put("pko","application/vnd.ms-pki.pko,vnd.ms-pki.pko");
        map.put("avi","video/avi,video/msvideo,video/x-msvideo");
        map.put("htc","text/x-component");
        map.put("wm","video/x-ms-wm");
        map.put("cat","application/vnd.ms-pki.seccat,vnd.ms-pki.seccat");
        map.put("json","application/json");
        map.put("m4a","audio/mp4,audio/MP4A-LATM,audio/x-m4a");
        map.put("crl","application/pkix-crl,pkix-crl");
        map.put("lpcm","audio/l16");
        map.put("sit","application/x-stuffit");
        map.put("jpg","image/jpeg,image/pjpeg");
        map.put("bmp","image/bmp");
        map.put("m4r","audio/x-m4r");
        map.put("jps","image/jps");
        map.put("wav","audio/wav,audio/x-wav");
        map.put("m4v","video/x-m4v");
        map.put("obb","application/vnd.android.obb");
        map.put("wax","audio/x-ms-wax");
        map.put("mp4","video/mp4");
        map.put("mp3","audio/mp3,audio/mpeg,audio/mpg,audio/x-mp3,audio/x-mpeg,audio/x-mpg");
        map.put("dds","image/vnd.ms-dds");
        map.put("tts","video/vnd.dlna.mpeg-tts");
        map.put("pdf","application/pdf");
        map.put("gz","application/x-gzip");
        map.put("application","application/x-ms-application");
        map.put("uvu","video/vnd.dece.mp4");
        map.put("potx","application/vnd.openxmlformats-officedocument.presentationml.template");
        map.put("pcast","application/x-podcast");
        map.put("pub","application/vnd.ms-publisher");
        map.put("xls","application/vnd.ms-excel");
        map.put("solitairetheme8","application/x-compressed");
        map.put("easmx","model/vnd.easmx+xps");
        return map;
    }

}
